package com.yzh.luckydraw.domain.award.service.goods.impl;

import com.yzh.luckydraw.common.Constants;
import com.yzh.luckydraw.domain.award.model.req.GoodsReq;
import com.yzh.luckydraw.domain.award.model.res.DistributionRes;
import com.yzh.luckydraw.domain.award.service.goods.DistributionBase;
import com.yzh.luckydraw.domain.award.service.goods.IDistributionGoods;
import org.springframework.stereotype.Component;

/**
 * 描述类商品，以文字形式展现用户
 */
@Component
public class DescGoods extends DistributionBase implements IDistributionGoods {
    @Override
    public DistributionRes doDistribution(GoodsReq req) {
        logger.info("模拟调用发放接口 uId：{} awardContent：{}", req.getuId(), req.getAwardContent());
        //更新用户领奖结果
        super.updateUserAwardState(req.getuId(), req.getOrderId(), req.getAwardId(), Constants.GrantState.COMPLETE.getCode());
        return new DistributionRes(req.getuId(), Constants.AwardState.SUCCESS.getCode(), Constants.AwardState.SUCCESS.getInfo());
    }
    
}
